﻿@model XRM.Security.WebUI.Models.UserRegister.UserRegisterDeleteSkziModel
@{
    ViewBag.Title = "Дата и причина удаления СКЗИ";
    Layout = "~/Views/Shared/_LayoutDialog.cshtml";
}

<div class="modal-body" style="height:170px;padding-left:20px;overflow-y:auto;">
    @using (Html.BeginForm("DeleteUserSkziDialog", "UserRegister", FormMethod.Post, new { id = "dlgDeleteUserSkziDialogForm", @class = "form-horizontal form-horizontal-2" }))
    {      
        @Html.AntiForgeryToken()
        @Html.HiddenFor(m => m.Id)
        const string inputCss = "form-control";
        const string divCss = "col-sm-8";
        
        <div class="form-group">
            @Html.LabelFor(m => m.DeleteDate, new { @class = "control-label required" })
            <div class="@divCss">
                @Html.EditorFor(m => m.DeleteDate)
                @Html.ValidationMessageFor(m => m.DeleteDate)
            </div>
        </div>
        
        <div class="form-group">
            @Html.LabelFor(m => m.DeleteReason, new { @class = "control-label required" })
            <div class="@divCss">
                @Html.TextAreaFor(m => m.DeleteReason, new { @class = @inputCss })
                @Html.ValidationMessageFor(m => m.DeleteReason)
            </div>
        </div>
    }    
</div>
<div class="modal-footer">
    @if (Model.IsEdit)
    {
        <a class="btn btn-default" data-dismiss="modal">Закрыть</a>
    }
    else
    {
        <div>
            <button type="submit" class="btn btn-primary submitBtn">Сохранить</button>
            <button type="button" class="btn btn-default" data-dismiss="modal">Отмена</button>
        </div>
    }
</div>

<script type="text/javascript">
        $(document).ready(function () {
            @if (Model.IsEdit)
            {
                <text>ReadOnlyView();</text>
            }
            initDatepicker();
            $("#DeleteDate").datepicker('option', 'maxDate', new Date());
        });
</script>


